package DoubanMovie;

/*
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class MovieRatingSystem {
    public static void main(String[] args) {
        List<DoubanMovie> movies = new ArrayList<>();
        movies.add(new DoubanMovie("肖申克的救赎", "弗兰克·德拉邦特", "蒂姆·罗宾斯/摩根·弗里曼", 9.7));
        movies.add(new DoubanMovie("星际穿越", "克里斯托弗·诺兰", "马修·麦康纳/安妮·海瑟薇", 9.4));
        movies.add(new DoubanMovie("我不是药神", "文牧野", "徐峥/王传君", 9.0));
        movies.add(new DoubanMovie("盗梦空间", "克里斯托弗·诺兰", "莱昂纳多·迪卡普里奥/约瑟夫·高登-莱维特", 9.4));
        movies.add(new DoubanMovie("三傻大闹宝莱坞", "拉吉库马尔··希拉尼", "阿米尔·汗/卡琳娜·卡普尔", 9.2));

        Scanner scanner = new Scanner(System.in);

        while (true) {
            System.out.println("请选择一部电影进行评分：");
            for (int i = 0; i < movies.size(); i++) {
                System.out.println((i + 1) + ". " + movies.get(i).getName());
            }
            System.out.println("0. 退出");

            int choice = scanner.nextInt();
            if (choice == 0) {
                break;
            }
            if (choice > 0 && choice <= movies.size()) {
                System.out.println("请输入您的评分（0-10）：");
                double newRating = scanner.nextDouble();
                DoubanMovie selectedMovie = movies.get(choice - 1);
                double updatedRating = selectedMovie.rate(newRating);
                System.out.printf("您为《%s》评分 %.6f，当前评分为 %.6f\n", selectedMovie.getName(), newRating, updatedRating);
            } else {
                System.out.println("无效的选择，请重新输入。");
            }
        }

        scanner.close();
    }
}
*/